import React, { lazy } from 'react'

const Home = lazy(() => import('../views/home'))
const Cart = lazy(() => import('../views/cart'))
const Classify = lazy(() => import('../views/classify'))
const My = lazy(() => import('../views/my'))


const Detail = lazy(() => import('../views/detail'))
const Order = lazy(() => import('../views/order'))
const PayResult = lazy(() => import('../views/payResult'))
const MainLayout = lazy(() => import('../views/mainLayout'))

// 二级 MainLayout
export const mainLayout_routes = [{
  path: '/',
  element: <Home></Home>,
  meta: {
    title: '首页'
  }
}, {
  path: '/classify',
  element: <Classify></Classify>,
  meta: {
    title: '分类'
  }
}, {
  path: '/cart',
  element: <Cart></Cart>,
  meta: {
    title: '购物车'
  }
}, {
  path: '/my',
  element: <My></My>,
  meta: {
    title: '我的'
  }
}]

// 一级
export const stastic_routes = [{
  path: '/',
  element: <MainLayout></MainLayout>,
  meta: {
    title: '布局'
  },
  children: mainLayout_routes
}, {
  path: '/detail/:id',
  element: <Detail></Detail>,
  meta: {
    title: '详情'
  }
}, {
  path: '/pay/result',
  element: <PayResult></PayResult>,
  meta: {
    title: '支付结果'
  }
}, {
  path: '/order',
  element: <Order></Order>,
  meta: {
    title: '订单'
  }
}]